package com.links.demo.rabbitmq.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author : ChadXiao
 * @email : chad.xiao@halobop.com
 * @date : 2019/9/6 16:39
 */
@Component
@RabbitListener(queues = "testQueue2")
public class MyRabbitMqReceiver1 {

    private Logger logger = LoggerFactory.getLogger(getClass());

    private int mIndex = 1;

    @RabbitHandler
    public void receive(String in){
        logger.info(" [-] Receiver[" + mIndex + "] Received '" + in + "'");
    }


}
